import { del, get,post, put } from "./http"

 
/**
 * 列表查询商家
 * @param {*} params 
 * @returns 
 */
export const listStore = (params)=>{
  const url = `/api/store/list`
  return get(url,params)
}
/**
 * 删除商家
 * @param {*} id 
 * @returns 
 */
export const removeStore = (id)=>{
  const url = `/api/store/${id}`
  return del(url)
}
/**
 * 保存或者更新商家
 * @param {*} data 
 * @returns 
 */
export const saveStore = (data)=>{
  const url = `/api/store`
  return post(url,data)
}
/**
 * 获取所有的店铺名称和ID
 * @param {*} params 
 * @returns 
 */
export const getAllName = (params)=>{
  const url = `/api/store/name`
  return get(url,params)
}
/**
 * 根据ID获取详情
 * @param {*} id 
 * @returns 
 */
export const getStoreById = (id)=>{
  const url = `/api/store/${id}`
  return get(url)
}